package src.origintrail;

/**
 *Class representing the Item of type Oxen
 * @author csmythe
 */
public class Oxen extends Item{
    private int health;
    private int healthMax;
    private int diffFact;
    
    /**
     * Constructor
     */
    public Oxen(){
        super();
    }
    /**
    *Initializer for an instance of Oxen
    *@param stack value containing the number of oxen
    */
    @Override
    public Oxen initialize(int stack) {
        super.initialize(stack, "Oxen", 500, 25.0);
        this.healthMax = 100;
        this.health = this.healthMax;
        this.diffFact = 1000;
        return this;
    }
    /**
    *Method that converts one of more oxen from Item type oxen to food.
    *@param i the player inventory that holds the oxen
	*/
    public void killOx(Inventory i){
        if(i.find(new Oxen()) != null){
            i.addItem(new Oxen().initialize(-1));
            i.addItem(new Food().initialize((int)(Math.ceil(this.health * this.weight /
                    this.diffFact))));
        }
    }

    

}
